import { ref } from 'vue'
export const defaultTablePaganationEffect = () => {
  const pagination = ref({
    current: 1,
    defaultPageSize: 10,
    total: 0,
  })
  const tableChange = (e) => {
    pagination.value.current = e.current
  }
  return {
    pagination,
    tableChange,
  }
}

export const useTablePaganationEffect = () => {
  const pagination = ref({
    current: 1,
    defaultPageSize: 10,
    total: 0,
    size: 'default',
    showTotal: (total) => `共 ${total} 条数据`,
    showSizeChanger: true,
    pageSizeOptions: ['10', '20'],
    // onShowSizeChange: (current, pageSize) => {
    // 	// this.form.pageSize = pageSize
    // 	// this.searchData()
    // 	console.log(123)
    // }
  })
  const pageChange = (page) => {
    pagination.value.current = page
  }
  return {
    pagination,
    pageChange,
  }
}
